package com.kly.chatter.api.application.controller.im.req;

import com.fqgj.common.api.ParamsObject;
import com.kly.sc.api.infras.enums.RestCodeEnum;
import com.kly.sc.api.infras.exception.ApplicationException;
import lombok.Builder;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import java.util.Objects;


/**
 * @author linqu
 */
public class ChatListRequest extends ParamsObject {

    private String modelUserCode;

    private Integer sessionSaveFlag;

    private Integer pageSize;

    private Integer pageNum;

    private String nickName;

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public ChatListRequest() {
    }

    public String getModelUserCode() {
        return modelUserCode;
    }

    public void setModelUserCode(String modelUserCode) {
        this.modelUserCode = modelUserCode;
    }

    public Integer getSessionSaveFlag() {
        return sessionSaveFlag;
    }

    public void setSessionSaveFlag(Integer sessionSaveFlag) {
        this.sessionSaveFlag = sessionSaveFlag;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public Integer getPageNum() {
        return pageNum;
    }

    public void setPageNum(Integer pageNum) {
        this.pageNum = pageNum;
    }


    @Override
    public void validate() {
        if (StringUtils.isBlank(this.modelUserCode)) {
            throw new ApplicationException(RestCodeEnum.USERID_NOT_EXIST_ERROR);
        }


    }
}
